package examples;

import mr.scan.SeqNumScan;

import org.apache.hadoop.util.ProgramDriver;

import util.DGO;

import examples.mr.ScanGrep;
import examples.mr.TestLos;
import examples.mr.TestMPS;
import examples.mr.TestSmaller;
import examples.mr.TestTagMatch;

/*
 * copied from hadoop examples
 */
public class ExamplesDriver {
	public static void main(String argv[]){
	    int exitCode = -1;
	    ProgramDriver pgd = new ProgramDriver();
	    try {
	      pgd.addClass("mps", TestMPS.class, 
	                   "A map/reduce program that counts the mps in the input files.");
	      pgd.addClass("los", TestLos.class, 
	                   "An Aggregate based map/reduce program that counts the words in the input files.");
	      pgd.addClass("smaller", TestSmaller.class, 
	                   "An Aggregate based map/reduce program that computes the histogram of the words in the input files.");
	      pgd.addClass("grep", ScanGrep.class, 
	                   "A map/reduce program that counts the matches of a regex in the input.");
	      pgd.addClass("datagenerator", DGO.class, 
	                   "A map/reduce program that writes random data .");
	      pgd.addClass("tagmatch", TestTagMatch.class, 
	      "A map/reduce program that match tags in a tag-sequence.");
	      pgd.addClass("scan", SeqNumScan.class, "A map/reduce program that scans the data written by the datagenerator.");
	      pgd.driver(argv);
	      // Success
	      exitCode = 0;
	    }
	    catch(Throwable e){
	      e.printStackTrace();
	    }
	    
	    System.exit(exitCode);
	  }

}
